package com.bw.services.model

import com.bw.common.const.Const
import com.bw.common.http.Res
import com.bw.services.entity.AddParkingEntity
import com.bw.services.entity.AddCarEntity
import com.bw.services.entity.AddCarInfoEntity
import com.bw.services.entity.AddcarData
import com.bw.services.entity.CarManage
import com.bw.services.entity.CarParkingEntity
import retrofit2.http.Body
import com.bw.services.entity.JmEntity
import com.bw.services.entity.JmEntityItem
import com.bw.services.entity.NewsEntity
import okhttp3.RequestBody
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path

interface ServicesApiServer {
    @GET(Const.BASE_CAR_MANAGE)
    suspend fun getCar_manage(@Path("licensePlate") licensePlate: String):Res<CarManage>

    @GET(Const.BASE_CAR_PARKING)
    suspend fun getCar_parking(@Path("areaId") areaId: Int):Res<List<CarParkingEntity>>

   //添加车辆
    @POST(Const.BASE_CAR_ADD)
    suspend fun addCar(@Body body: RequestBody):Res<AddcarData>

    //获取各省简码
    @GET(Const.BASE_CAR_JM)
    suspend fun getJm():Res<List<JmEntityItem>>
    //添加车辆信息
    @POST(Const.BASE_ADD_CAR_INFO)
    suspend fun addCarInfo(@Body body: RequestBody):Res<AddCarInfoEntity>


    @POST(Const.BASE_CAR_Add_PARING)
    suspend fun getCar_Add_Parking(@Body addParking: CarParkingEntity):Res<CarParkingEntity>

    @PUT(Const.BASE_CAR_UpData_PARING)
    suspend fun getCar_UpData_Parking(@Path("id") id: Int,@Body addParking: CarParkingEntity):Res<CarParkingEntity>


    @GET(Const.BASE_NEWS)
    suspend fun getNews():Res<List<NewsEntity>>


    @POST(Const.BASE_ADD_NEWS)
    suspend fun addNews(@Body addNews: NewsEntity):Res<NewsEntity>
}